<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8"/>
    <title>AddServer</title>
    <link rel="stylesheet" type="text/css" media="all" href="/layui/css/layui.css"/>
    <script type="text/javascript" src="/layui/layui.all.js"></script>
    <script type="text/javascript" src="/layui/layui.js"></script>
    <script type="text/javascript" src="/js/jquery.min.js"></script>
    <script type="text/javascript" src="/js/myJs.js"></script>
    <script type="text/javascript" src="/js/bootstrap.js"></script>
    <link rel="stylesheet" type="text/css" media="all" href="/css/common.css"/>
    <link rel="stylesheet" type="text/css" media="all" href="/css/CaseManager.css"/>
</head>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>新加服务</legend>
</fieldset>
<body>
<br/><br/><br/>
<div class="layui-container">
    <!--6/12 布局-->
    <div class="layui-row">
        <div class="layui-col-xs-offset3">
            <form id="serverform2" class="layui-form layui-form-pane"><br/><br/><br/>
                <!--服务名-->
                <div class="layui-form-item">
                    <label class="layui-form-label ">服务名</label>
                    <div class="layui-input-inline" style="width: 300px;">
                        <input type="text" name="vServerName" autocomplete="off" class="layui-input" />
                    </div>
                </div>
                <!---所属系统-->
                <div class="layui-form-item">
                    <label class="layui-form-label ">所属系统:</label>
                    <div  class="layui-input-inline" style="width: 300px;">
                        <div class="layui-form">
                        <select name="vSystem" id="vSystemSelect">
                            <option value="未知">选择类型</option>
                        </select>
                        </div>
                    </div>
                </div>
                <!---服务类型-->
                <div class="layui-form-item">
                    <label class="layui-form-label ">服务类型:</label>
                    <div  class="layui-input-inline" style="width: 300px;">
                        <div class="layui-form">
                            <select name="vServerType" id="BaseServerType">
                                <option value="未知">选择类型</option>
                            </select>
                        </div>
                    </div>
                </div>
                <!--代码地址-->
                <div class="layui-form-item">
                    <label class="layui-form-label ">代码地址</label>
                    <div class="layui-input-inline" style="width: 300px;">
                        <input type="text" name="vGitUrl" required="required" autocomplete="off" placeholder="" class="layui-input" />
                    </div>
                </div>
                <!--负责人-->
                <div class="layui-form-item">
                    <label class="layui-form-label ">负责人</label>
                    <div class="layui-input-inline" style="width: 300px;">
                        <input type="text" name="vLeader" autocomplete="off"  class="layui-input" />
                    </div>
                </div>
                <!---是否启用-->
                <div class="layui-form-item">
                    <label class="layui-form-label">是否启用</label>
                    <div class="layui-input-block">
                        <input type="checkbox" name="eStatus" lay-skin="switch" checked="checked" value="on" />
                    </div>
                </div>
                <div class="layui-collapse" lay-filter="lxk" style="width: 410px">
                    <div class="layui-colla-item">
                        <h2 class="layui-colla-title">更多信息</h2>
                        <div class="layui-colla-content" >
                            <div  class="layui-input-inline" style="width: 350px;">
                                <div class="layui-form">
                                    <select name="vLanguage" id="vLanguageSelect">
                                        <option value="未知">开发语言</option>
                                    </select>
                                </div>
                                <br/>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-input-inline" style="width: 350px;">
                                    <input type="text" name="vCompile" autocomplete="off" placeholder="" value="标准编译" class="layui-input" />
                                </div>
                            </div>
                            <div  class="layui-input-inline" style="width: 350px;">
                                <div class="layui-form">
                                    <select name="vDeployUrl" id="vDeployUrlSelect">
                                        <option value="未知">部署路径</option>
                                    </select>
                                </div><br/>
                            </div>
                            <div  class="layui-input-inline" style="width: 350px;">
                                <div class="layui-form">
                                    <select name="vDeployType" id="vDeployTypeSelect">
                                        <option value="未知">部署方式</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <br/>
                <!--提交按钮-->
                <button type="button" style="width: 410px" class="layui-btn" lay-filter="adds" id="adds" lay-submit="">提交</button>
            </form>

        </div>
    </div>
</div>
<br/><br/><br/><br/><br/><br/><br/><br/>
<div class="fly-footer layui-col-xs-offset5" >
    <p><a target="_blank">我打 - 服务管理系统</a> 2018</p>
</div>


</body>

<script>
    layui.use(['element', 'layer'], function(){
        var element = layui.element;
        //监听折叠
        element.on('collapse(xlk)', function(data){
            console.log('展开状态：'+ data.show);});
    });
    layui.use('form', function(){
        var form = layui.form;
       // form.render();
        //监听提交
        form.on( 'layui','submit(adds)',function(data){
            var from= $("#serverform2");
            var model= serializeObject(from);
            $.ajax({
                type: "post",
                url: "/server/addBaseServerSC",
                contentType: "application/json; charset=utf-8",
                data: JSON.stringify(model),
                dataType: "json",
                success: function(data) {
                    layer.confirm('新建成功', function(index){
                        loadPage("/server/baseServer");
                    });
                }
            });
            return false;
        });
    });
</script>
</html>